package com.colorlight.cloud.xm.api;

import com.colorlight.cloud.all_event.AllProtocolType;
import com.colorlight.cloud.gateway.api.message.constraint.schedule.ScheduleActions;
import com.colorlight.cloud.gateway.api.message.model.Msg;
import com.colorlight.cloud.gateway.api.message.process.ProcessMessageEventHandler;
import com.colorlight.cloud.xm.entity.enumerate.NameStruct;


/**
 * @author Demon
 * @date 20/1/2024  下午2:28
 */
public interface XmProcessMessageEventHandler<K extends ScheduleActions> extends ProcessMessageEventHandler<K> {
	/**
	 * 协议层面的区分
	 *
	 * @return 协议名
	 * @author Demon
	 **/
	@Override
	default String getProtocolType() {
		return AllProtocolType.NAME_STRUCT_XM.getType();
	}
	
	
	/**
	 * 获取该接口实现对应的指令枚举
	 *
	 * @return 指令枚举
	 */
	@Override
	NameStruct getInstructionType();
	
	/**
	 * 指令处理
	 *  @param deviceName   设备名称
	 * @param protocolType 协议类型
	 * @param msg          指令实体信息
	 */
	@Override
	default void accept(String deviceName, String protocolType, Msg<K> msg) {
		accept(deviceName, msg);
	}
}
